home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Libris Britannia 4
/
science library(b).zip
/
science library(b)
/
PROGRAMM
/
PASCAL
/
0798.ZIP
/
SE.DOC
< prev
next >
Wrap
Text File
|
1987-10-05
|
90KB
|
2,783 lines
ScreenEngine
A screen design program for Turbo Pascal users
by
Pedro J. and Jennifer L. Restrepo
Newton Microsoftware
P.O. Box 318
New Town Branch
Boston, MA 02258
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Introduction to ScreenEngine..........................................1
Ordering ScreenEngine............................................1
Introduction to ScreenEngine.....................................2
Basic Concepts...............................................2
A Short Glossary.............................................2
ScreenEngine Menus...........................................3
Menus for Color or Monochrome Monitors..................3
Main Menu Options.......................................3
The File Directory Utility...................................4
Moving the Cursor Around the Screen..........................4
Marking or Pointing at Items.................................5
Making Complex Boxes.........................................5
Sorting Items................................................5
Boxes...................................................5
Variables...............................................6
The Program's Output.........................................6
The Sample Files.............................................8
ScreenEngine Reference.................................................9
The Main Menu.....................................................9
Make.........................................................9
Retrieve....................................................10
Save........................................................10
Clear.......................................................11
Quit........................................................11
Screen Design Menu...............................................12
Box.........................................................12
Complex Box............................................13
Label.......................................................14
Variable....................................................15
Change Box..................................................16
Background.............................................16
Foreground.............................................17
Type...................................................17
Size...................................................17
Execute................................................18
Change Label................................................18
Background.............................................18
Foreground.............................................19
Label..................................................19
Execute................................................19
Change Variable.............................................19
Background.............................................20
Foreground.............................................20
Name...................................................20
Type...................................................21
Type Integer...........................................21
Type Real..............................................22
Type String............................................22
Type Date..............................................22
Length.................................................24
Display................................................24
Display Scientific.....................................24
Display Fixed..........................................25
Display Dollar.........................................25
Display Percent........................................26
Display Comma..........................................26
Protection.............................................26
MinMax.................................................27
Execute................................................28
Move........................................................29
Item...................................................29
Range..................................................29
Duplicate...................................................31
Alter.......................................................32
Erase.......................................................33
UnErase.....................................................34
Sort........................................................35
Variables..............................................35
Boxes..................................................35
Quit........................................................36
The Generated Program and the ScreenEngine utilites...................37
The Generated Program............................................37
Generated Procedures........................................37
ScrnXXXX...............................................37
PutTitleScrnXXXX.......................................37
OutVarScrnXXXX.........................................37
InpVarScrnXXXX.........................................37
InpScrXXXX.............................................38
EditScrXXXX............................................38
OutScrXXXX.............................................38
Predefined Variables........................................39
The ScreenEngine Utilities.......................................40
SE.UTL......................................................40
Beep...................................................40
Box....................................................40
GetString..............................................40
GetVariable............................................41
MakeStr................................................41
NormCursor.............................................41
PeelBlanks.............................................41
PutVariable............................................41
SCursor................................................41
SetColor...............................................42
Reset Color............................................42
SEREAL.UTL..................................................42
ConvReal...............................................42
GetReal................................................42
InsCommas..............................................42
PeelChars..............................................43
PutReal................................................43
SEINT.UTL...................................................43
GetInteger.............................................43
PutInteger.............................................43
SEDATE.UTL..................................................43
GetDate................................................43
MakeDateStr............................................43
PutDate................................................43
Introduction Page 1
INTRODUCTION TO ScreenEngine
ScreenEngine is a tool that will assist you in designing screens for input
and output of variables in your Turbo Pascal programs. ScreenEngine is
distributed under the "ShareWare" concept, that means that you are allowed to
make and distribute copies of the program, provided that you do not
modify the program in any way, nor receive monetary compensation. If you use
the program, you are asked to send $30.00 (Mass. residents send $31.50) for
each working copy of the program, in U.S. currency (Check or money order).
Site licenses are available. Registered users will be kept informed of new
releases.
-----------------------------------------------------------------------------
TO: Newton Microsoftware
Post Office Box # 318
New Town Branch
Boston, MA 02258
Please send me ____ copies of ScreenEngine at $30.00 each.
(Mass. residents add $1.50 per copy)
Name______________________________________
Address__________________________________
City or Town______________ State__ ZIP______
-----------------------------------------------------------------------------
All the rights to this program are reserved by Pedro J. Restrepo, Newton
Microsoftware. Please address in writing all questions regarding ScreenEngine
to the above address.
This program is provided as is and no warrantee, expressed or implied,is made
as to its usefulness for any intended purpose or its reliability. The author
is not liable for any loss resulting from the use of this program.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Introduction Page 2
Introduction to ScreenEngine.
Basic Concepts.
Use a computer with an IBM color graphics card, an Enhanced Graphics adapter
or compatible to fully appreciate the program's capabilities. (The program has
been tested on IBM, Compaq and Zenith machines). ScreenEngine will also work
well on machines with monochrome or Hercules card and monitor, but since
monochrome monitors like the IBM do not display shades of green instead of
colors, users may not be able to completely see a screen which was designed
for color monitors. Color monitors include the true multi-hued monitors as
well as those offering several shades of one color (amber, green or gray),
like those in the Compaq and the AT&T computers. The "color" options of the
monochrome monitors are:
(1) Dark screen background and bright text.
(2) Dark screen background and underlined text.
(3) Bright screen background and dark text.
ScreenEngine will automatically detect which graphics adapter is active and
set the internal color options accordingly. To execute the program, change the
active directory to the directory in which the program was copied and type
either "SE". ScreenEngine will initialize the system and read two files that
must reside in the same directory as SE.COM. These three files are: SE.000,
SE.MSG and SE.MNU. SE.000 contains some programs which are required to
initialize the system. SE.MNU and SE.MSG contain the menus and error messages,
respectively. If the program can't find the ".MNU" AND ".MSG" files, it will
ask you to input the name of the directory in which they are stored.
A Short Glossary:
In this manual and in ScreenEngine each entry on the screen constitutes an
"item". There are 3 types of items: Boxes, Labels and Variables. A "box" may
be either a rectangular or square box, a line or an individual box-drawing
character. A "label" is anything you write on the screen, like titles or
headings. A "variable" is actually the area on the screen where you want to
input or output a variable.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Introduction Page 3
ScreenEngine Menus.
All ScreenEngine menus include 2 lines:
The first line displays the menu choices. One of the choices is highlighted in
reverse video. The highlighting may be moved among menu selections by pressing
the [Right] and [Left] arrow keys. You may choose the highlighted selection by
pressing [ENTER]. You may also choose any option by typing the first letter of
the menu selection without the need to highlight the choice.
The second line of each menu describes the function of the currently
highlighted selection. Many of these description lines are fully explanatory.
In the reference manual we will describe all menus and their submenus, and the
queries from the program that the user is required to answer for some menu
selections.
In all descriptive sections of the reference manual, we will highlight the
current choice by using upper case letters. The menu prompt and menu
selections will appear with the description line for the current menu choice
right below. The general form will look like the following:
=========================================================================
MENU PROMPT LINE (If any)
First-choice Second-choice CURRENT-CHOICE Fourth-choice
Description line for current choice
=========================================================================
A description of CURRENT-CHOICE will then follow.
Menus for Color or Monochrome Monitors.
Because of the imposibility of the monochrome display to show any "Gray
Scale" colors except reverse video, ScreenEngine has two different color
menus: the "color" menu for the monochrome adaptor gives the choices of normal
video, reverse video or underlined. The color menu for the color graphics
adapter has 8 different choices for background and 16 choices for foreground
colors. ScreenEngine will not allow the same colors for foreground and
background, because this will make the foreground invisible.
Main Menu options:
The first option, "Make", allows you to either create a new screen, or
continue editing. The second option, "Retrieve", allows you to specify the
name of a screen you previously created (and "Saved"). Use this option to read
the file SAMPLE.PAS into SE. When prompted for the file name, you do not have
to type the .PAS extension. After you have retrieved the existing SAMPLE.PAS
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Introduction Page 4
file, you will be in the "SCREEN DESIGN MENU". The menu area is permanently
displayed.
The File Directory Utility.
ScreenEngine is equipped with a versatile file directory. It is automatically
displayed in two cases: 1) when you type a "?" instead of a file name when
responding to the "Retrieve" option of the main menu; and 2) when you are
saving your file and ScreenEngine finds that there is no more space on the
disk. The file directory utility displays up to 255 files per directory. The
file names or directories are sorted alphabetically by name. Directories are
marked with a "D*" at their right.
Using the Directory Utility.
Selecting a file.
To assist you with the selection of the file, your default directory
will be displayed. Use the cursor keys to highlight the file you want to
RETRIEVE. By pressing [ENTER], ScreenEngine will read the highlighted
file.
Changing directories.
There are two ways of changing directories within ScreenEngine. The
first one is by highlighting a subdirectory and pressing [ENTER]. The
second one is by typing "C" and then typing the complete Path, starting
with the drive designator. In both cases, ScreenEngine will display the
files and directories in that subdirectory. Use the second technique to
list another drive's directory. To return to the parent directory,
highlight the ".." directory and press [ENTER].
Erasing a file.
ScreenEngine lets you erase a file in case you are running out of space
on your disk. To do so, type "E" and the file will be erased.
Moving the Cursor Around the Screen:
Use the arrow keys in the normal way. The [Home], [PgUp], [PgDn] and [End]
keys will move the cursor diagonally. By pressing the [Ctrl] key at the same
time as any of the keys that move the cursor either diagonally or
horizontally, the cursor horizontal movement is accelerated by a factor of 5.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Introduction Page 5
You may move the cursor anywhere on the screen. You may position items
anywhere on the screen, exept at the bottom right corner (Row 25, Col 80) of
the screen, since this would cause the screen to scroll up. If you want to
position an item in the area normally used by the ScreenEngine menu just move
the cursor to the desired location. ScreenEngine will automatically move the
menu display area to the top of the screen, until you place the cursor in that
area.
Marking or Pointing at Items:
Some menu options will ask you to point at an item to mark it. To do this,
place the cursor anywhere on the label, the variable location, or on the
border of a box a line, or a graphic character and press [Enter].
Making Complex Boxes:
This is probably one of the most useful options of ScreenEngine. We mean by a
"Complex box" a box that has internal divisions, special graphics characters
or other boxes. ScreenEngine treats a complex box as a unity when changing,
duplicating, erasing or moving the box. However, when "Unerasing" a previously
erased complex box, only the "Mother box" will be recreated. You may move,
erase, unerase, duplicate, but not change the colors of any of the
subcomponents of the complex box. You may make any other mother boxes with any
other colors, inside, outside, or overlapping any existing box. The advantage
of this approach lies in the very compact source code that is produced. Notice
the first call to the "Box" procedure in the source SAMPLE.PAS program. The
string within quotes contains the information regarding the subcomponents of
the mother box.
Sorting Items:
There are two reasons for which you may want to "Sort" items.
Sorting Boxes:
If you decided to include a box covering an area in which you already have
laid out some boxes, you will find that the background of the new box will
cover the existing boxes underneath. Choose the "Sort" command, select the
"Box" option, and ScreenEngine will display the screen in a "See-through"
mode that will allow you to see all boxes. "Mark" the boxes in the order
in which you want them to be displayed in the screen. You only have to
mark the "Mother" boxes. ScreenEngine will type the order of the box you
have just marked on the upper left corner of the box, both to indicate
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Introduction Page 6
that the box has already been marked, and to remaind you of the sorting
order. Press [Enter] twice when marking the last box to indicate that you
have finished.
Sorting Variables:
ScreenEngine will normally generate the source program in a form that will
prompt the user to input the variables in the same order in which the
variables were created when the screen was originally designed. However,
the designer of the screen may have moved variables around, or may want to
specify a particular order in which the variables should be input. The
"Sort Variables" option will enable the designer to indicate the order in
which the variables should be prompted to the user. As in the "Sorting
Boxes" case, "Mark" the variables in the order in which you want them to
be prompted.
The Program's Output.
As already mentioned, SE will write a source Turbo Pascal program that
you can modify and enhance to suit your needs. At the beginning of the
program, SE includes a Turbo Pascal comment that has screen coordinates, color
and other information useful in reconstructing the screen. The contents of
this comment is described next:
The first line always is:
(*SCREENENGINE
The second line contains the name you gave to the screen. For instance:
Test
The third line always contains 4 integer values:
MonType BgCol FgCol NItems
Montype is the type of monitor you are using: 1=color, 2= monochrome.
BgColor is the color of the screen Background.
FgColor is the color of the screen Foreground.
NItems is the number of items you created. The following count as one item:
A single box.
A single line.
A single box-drawing character.
A label (Up to 80 characters long).
A variable.
Next, the program will write "NItems" lines with the following data:
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Introduction Page 7
xo yo x1 y1 L BgCol FgCol Code Protec/Ref NameS;
xo,yo : Upper left corner coordinates.
x1,y1 : For boxes, lower right corner coordinates.
Unused for labels, integer variables and string variables.
For real variables x1 indicates the format and y1 the number of
decimals.
For Date variables x1 indicates the format.
L : For rectangular boxes or lines, the border symbol type, 1 through 4.
For individual box-drawing characters, the decimal ASCII code.
BgCol : Background color.
FgCol : Foreground color.
Code : Identifies the item:
Boxes = 1;
Labels = 2;
Integer variables = 3;
Real variables = 4;
String variables = 5;
Date variables = 6;
Protec/Ref: Boxes:
Mother boxes = 0;
Subcomponents <>0, point at the item number of the
mother box.
Labels: Unused.
Variables:
Protected = 1;
Not protected = 0;
Name : Boxes : Unused.
Labels : Contains the label.
Variables: Name of the variable, as input by the screen designer
or as generated by ScreenEngine.
If the item is a variable, (Codes 3 through 6), it will be followed by one or
two more lines containing the minimum and maximum value for that variable.
The last line is always a *).
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Introduction Page 8
ScreenEngine expects to read an unmodified data file. Therefore, very little
validation of the data is made. By changing the items in the file with the
help of an editor, you may cause ScreenEngine to crash.
The Sample Files:
In your diskette you will find the following files:
SE.COM : The main program.
SE.000 : The overlay file. This file is used just to initialize
the program. Once the Screen Design Menu is displayed,
it is safe to remove the ScreenEngine disk.
SE.MSG : This file contains the messages that are displayed
during the program's execution.
SE.MNU : This file contains the menus. Should not be changed.
SAMPLE.PAS : This file shows a typical, unedited program created with
SE.
SAMPLE.COM : This is a compiled version of the above. You may input
some values and find out how a ScreenEngine created
program will look and validate data.
ORBIT.PAS : This is a program with an opening screen designed with
ScreenEngine, and subsequently edited to take advantage
of the array structure of the data. If you have a color
graphics adapter or compatible, you will be able to run
its compiled version.
ORBIT.COM : This is the compiled version of the above.
ORBIT.DOC : A very brief documentation of the program. Try it!
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Main Menu Page 9
ScreenEngine REFERENCE
1. The Main Menu.
The main menu includes the basic processing options for ScreenEngine.
These allow the user to create new screens, edit existing screens, save
the current work, clear the current screen and start a new one, and quit
ScreenEngine.
1.1 MAKE
==============================================================================
Main Menu
MAKE Retrieve Save Clear Quit
Create a new screen or continue editing current one.
==============================================================================
You will choose the MAKE option to begin designing a new screen or if
you have been editing an existing screen and wish to re-edit some item
before saving or quitting ScreenEngine. You will be asked to enter a
valid DOS file name. This name will be used to create a disk file that
will contain the generated Turbo Pascal source code. The same file name
will be used in association with other prefixes to name the internal
procedures to input, outupt and edit data that will identify the screen
within your program. Use 8 characters or less. Use only letters or
numbers following a letter, with no blanks or other special characters.
Examples of valid identifiers are:
Invntory
Address
DataBase
VisRecrd
Examples of invalid identifiers are:
123 (Does not start with a letter)
ClientInformation (Too long)
Screen 1 (Imbedded blank)
Then, if you chose the name "VisRecrd", for example, ScreenEngine will
create several procedures with names like InpVisRecrd, OutVisRecrd,
EditVisRecrd within your generated code. (See Section 3.1).
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Main Menu Page 10
1.2 Retrieve
==============================================================================
MAIN MENU
Make RETRIEVE Save Clear Quit
Retrieve a previously created screen to edit or combine with current one.
==============================================================================
You must have a previously saved screen in order to use this menu
selection. When you use RETRIEVE, ScreenEngine will ask you to enter the
filename in which your screen was saved, or type "?" to obtain a listing
of the current filenames in your default directory. (See "The File
Directory Utility" in the "Introduction to ScreenEngine".
Combining previously created files.
You may combine one or more stored screens with the one on which you are
currently working. By retrieving each screen in turn you may have
several screens diplayed on the monitor at the same time. Remember,
however, that if parts of the screen to be retrieved occupy the same
space on the monitor as that which is currently resident, they will
cover (but not erase) the screen on which they are superimposed. You may
then use ScreenEngine editing capabilities to move items around and
display all parts of the screen, or erase items not wanted.
1.3 Save.
==============================================================================
MAIN MENU
Make Retrieve SAVE Clear Quit
Save your work into a file.
==============================================================================
If you wish to save your screen, either as a final product or for later
editing, use the SAVE option. The program will display the filename you
chose under the MAKE option and ask if you want to accept the name
and/or directory in which the file will be saved. If you wish to change
either the filename or directory, you may do so at this point.
ScreenEngine will then save your file in the directory you have
selected. If there is not enough room in that directory, ScreenEngine
will display the files and give you the option to erase a file, or to
change directory. You may also insert a new formatted floppy.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Main Menu Page 11
1.4 Clear.
==============================================================================
MAIN MENU
Make Retrieve Save CLEAR Quit
Clear current work and start a new screen.
==============================================================================
The CLEAR option is used to clear the monitor area of all work to leave
it ready for creating new screens or editing old ones. If you want to
save the work currently on the screen, use the SAVE option before
CLEAR. When you choose CLEAR the program will check to see if your work
has been saved and will ask you in you wish to save it if you have not
already done so.
1.5 Quit.
==============================================================================
MAIN MENU
Make Retrieve Save Clear QUIT
Quit ScreenEngine.
==============================================================================
The QUIT option allows you to leave ScreenEngine and return to DOS.
The program checks if you have save your work and will ask you to save
it if you have not already done so. You may want to quit without
saving.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 12
Creating Boxes
2. Screen Design Menu
The screen design menu will appear if your selection on the main menu was
either Make or Retrieve. The Screen Design Menu is the vehicle by which
you will design your input/output screens. Each selection on this menu will
be described and its sub-menu selections examined in detail before moving
to the next screen design selection. This menu is always present on the
display. (See "Moving the Cursor Around the Screen").
2.1 Box
==============================================================================
SCREEN DESIGN MENU
BOX Label Variable Change Move Duplicate Alter Erase Unerase Sort Quit
Define a rectangular box, a line or any special graphic symbol.
==============================================================================
Boxes, lines and graphic symbols are used to define and separate areas of
the screen for organizational purposes, or to emphasize certain areas.
These items are optional: you may define input/output areas without using
any boxes or lines. However, because of the visual impact of a display
screen well designed with boxes and separating lines of different colors,
it is highly recommended to add those eye-cathing elements to your
screens. ScreenEngine makes it very easy to design and layout these
elements to your screens.
Within ScreenEngine, boxes may be "Simple" or "Complex". A simple box
consist of just the outer frame. Complex boxes contain internal divisions
made up of lines, other boxes and box-drawing characters use to improve
the apperance of box and line intersections. Very intricate screen designs
may be accomplished using the complex box feature, which is part of the
BOX submenu described below.
When you select Box from the screen Design Menu you must then choose the
type of character to be used for drawing boxes or lines; you may also
choose to create a "Complex" box. The first four options above offer the
following charaters for drawing lines or boxes:
1 = use single line for box or line
2 = use double line for box or line
3 = use half-character wide solid line
4 = use full-character wide solid line
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 13
Creating Boxes
If you choose to draw a simple line or box using one of the four box
drawing characters, select one number. The following question will the
appear:
Accept default colors for boxes and lines? Yes/No
If you choose no, you will be presented with 7 choices for the background
color or shade inside of the box, and 15 choices for the color of the
line or box outline itself. After making these choices proceed as
follows.
If you answer yes to the question above, or if you are finished selecting
colors, you will be asked to position the cursor on one corner of the box
or line, and press [ENTER] to anchor the box or line corner to that point
on the display. You may expand or shrink the box or line to any desired
size by using the cursor keys. (See Moving the Cursor Around the Screen").
With these keys you will control a shaded area, depicting the boxed area,
to appear and move on the screen. The character used to show this box or
line is not the final box-drawing character that will be used; it is
simply a way of showing what area your line or box will cover.
After you have expanded the box or line to the desired size, press [ENTER]
once more to complete the figure on the screen. ScreenEngine will return
to the Screen Design Menu.
NOTE: ScreenEngine uses only standard Turbo Pascal "write" procedures to
draw boxes. Because of this, writing anything on row 25, column 80 of the
screen will cause the screen to scroll up one line. ScreenEngine will
ignore that corner when instructed to design a box that will go through
row 25, column 80.
2.1.2 Complex Box.
Complex boxes are any boxes in which a simple four-sided box has been
enhanced by the use of special box-drawing characters or by "nesting"
other boxes either inside or outside the main (or "Parent") box. TURBO-
SCREEN considers all components of a complex box as a unit, which makes it
easier to change, move or erase. Moreover,when designing boxes as complex,
ScreenEngine needs only one single procedure call to draw the complete
box, thus saving valuable code space. A restriction of the use of a
complex box is that all the components of the complex box have the same
colors for background and for foreground. If you need to place a box
within another box of a different color,you must use the BOX command
already described.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 14
Creating Labels
2.2 Label.
==============================================================================
SCREEN DESIGN MENU
Box LABEL Variable Change Move Duplicate Alter Erase Unerase Sort Quit
Input a title.
==============================================================================
In ScreenEngine, labels are descriptors that tell the screen user what
particular item of information is required or displayed at that point on
the screen. For instance, if you want the user to enter somebody's last
name on the screen the label for this area might be:
"Last Name:"
ScreenEngine will then ask you to position the cursor at the point at
which you want the label to appear and enter your label. Use the
backspace, [Del], [Ins] and Right and Left arrow keys to correct any
mistakes you may make. Notice that if you erase some characters, the
background area will be larger than the length of the label until you
re-type some characters over it, or press [Enter] to finish your label.
After your label is complete, ScreenEngine will redisplay the Change Label
Menu, which is explained in section 2.4. If you do not want to make any
changes at this point, choose the "Execute" option to return to the screen
design menu.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 15
Creating Variables
2.3 Variable.
This selection of the Screen Design Menu enables you to locate on the
screen and to describe actual Pascal variables to be input or displayed on
the screen.
There are four types of variables in ScreenEngine: Integer, real, string
and date. The first three types correspond to the standard Turbo Pascal
variables. The "date" is a type of string variables which contains 6 ASCII
characters. Internally these characters are organized as YYMMDD. This
allows for dates to be compared and sorted in an application program.
ScreenEngine has a number of options to display and/or input date type
variables, as will be shown below.
When you choose the Variable selection, ScreenEngine will ask you to move
the cursor to the screen location at which you want to display or input
the variable. You indicate the location of the first character by pressing
[Enter]. Then, you may press the [Space] bar to indicate the total length
of the field where your variable will be displayed. Press [Enter] again
when you are finished. ScreenEngine assumes several default values when
you first create a variable. ScreenEngine will then display the Variable
Change Menu and a small window will appear informing you of the current
features of the variable. You may want to change them as explained in
Section 2.4.3. Proceed with your changes and select "Execute" to return to
the screen design menu.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 16
Change
2.4 Change.
==============================================================================
SCREEN DESIGN MENU
Box Label Variable CHANGE Move Duplicate Alter Erase Unerase Sort Quit
Modify any single item on the screen (Label,variable type,color,format,etc.)
==============================================================================
When the "Change" option is selected from the Screen Design Menu, the
following message is displayed:
CHANGE. Position cursor on item to be changed and press [ENTER].
Once you have selected the item to be changed, ScreenEngine will display
one of three menus according to whether the item is a box, a label or a
variable. Notice that the changes you make are not executed immediately,
but you must choose the "Execute" option of each menu to make them
effective.
2.4.1 Changing Boxes.
Selecting a box, a line or a graphic character to be changed will
display the following menu:
Change (Box)
Background:
==============================================================================
CHANGE BOX OR GRAPHICS CHAR. Make all your choices and type "E" to proceed:
BACKGROUND Foreground Type Size Execute
Change the color of the background
==============================================================================
This option will allow you to specify a different color for the
background. If you marked a complex box, all subcomponents of the
complex box will automatically change background color. (See "Menus for
Color or Monochrome monitors"). If the element at which you pointed was
a subcomponent of a complex box, ScreenEngine will not allow change of
background or border symbol colors.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 17
Change
Change (Box)
Foreground:
==============================================================================
CHANGE BOX OR GRAPHICS CHAR. Make all your choices and type "E" to proceed:
Background FOREGROUND Type Size Execute
Change the color of the box border symbol
==============================================================================
This option will allow you to specify a different color for the box
border. If you marked a complex box, all subcomponents of the complex
box will automatically change box border color. See "Menus for Color or
Monochrome monitors".
Change (Box)
Type:
==============================================================================
CHANGE BOX OR GRAPHICS CHAR. Make all your choices and type "E" to proceed:
Background Foreground TYPE Size Execute
Change the box border symbol
==============================================================================
This option will display the menu shown below, which is similar to the
one shown when designing a box. The only difference between both menus
is that the "Change (Box) Type" menu does not offer a "complex box"
option:
==============================================================================
Select type of graphic character for Box or line, or make complex box.
1=-------- 2= ========= 3= 4=
Use single line for box or line
==============================================================================
Change (Box)
Size:
==============================================================================
CHANGE BOX OR GRAPHICS CHAR. Make all your choices and type "E" to proceed:
Background Foreground Type SIZE Execute
Change the size of the box
==============================================================================
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 18
Change
This option is not offered for individual symbols. ScreenEngine will
display the current box in highlighted mode. Use the cursor keys to
enlarge or decrease the size of the box. If you wanted to change the
size to the left or up, you may have to move the box such that its upper
left corner occupies the position you want it to, and next use the
Change Size option to move the lower left corner to its new position.
Change (Box)
Execute:
==============================================================================
CHANGE BOX OR GRAPHICS CHAR. Make all your choices and type "E" to proceed:
Background Foreground Type Size EXECUTE
Proceed with the changes and return to screen design menu
==============================================================================
This option makes effective all changes and return to the screen design
menu
2.4.2 Change Label.
Change (Label)
Background
==============================================================================
CHANGE LABEL. Make all your changes and type "E" to proceed
BACKGROUND Foreground Label Execute
Change the color of the label background
==============================================================================
This choice allows you to modify the background color of the label at
which you pointed.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 19
Change
Change (Label)
Foreground:
==============================================================================
CHANGE LABEL. Make all your changes and type "E" to proceed
Background FOREGROUND Label Execute
Change the color of the label text
==============================================================================
This choice allows you to change the color of the alphanumeric
characters that form the label.
Change (Label)
Label:
==============================================================================
CHANGE LABEL. Make all your changes and type "E" to proceed
Background Foreground LABEL Execute
Change the text or length of the label
==============================================================================
Change label allows you to modify the label itself, adding or deleting
characters. Use the cursor keys, the backspace, delete and Insert keys
to assist you.
Return to screen design menu:
==============================================================================
CHANGE LABEL. Make all your changes and type "E" to proceed
Background Foreground Label EXECUTE
Proceed with the changes and return to screen design menu
==============================================================================
2.4.3 Change Variable.
When you select a variable to be changed, ScreenEngine displays the
Change Variable menu. In addition, a small window opens displaying the
current name, type, display format if any, protection attribute, and, if
the variable is not protected, the minimum and maximum values for data
validation. Data in this window will change instantaneously after you
make any modification:
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 20
Change
+-----------------------------+
| Name: |
| Type: |
| Display format: |
| Protection |
| |
| Maximum Value: |
| |
| Minimum Value: |
| |
+-----------------------------+
Change (Variable)
Background:
==============================================================================
CHANGE VARIABLE. Make all your changes and type "E" to proceed
BACKGROUND Foreground Name Type Length Display Protection MinMax Execute
Change the background color of the variable input/output field.
==============================================================================
This option lets you specify a new background color.
Change (Variable)
Foreground:
==============================================================================
CHANGE VARIABLE. Make all your changes and type "E" to proceed
Background FOREGROUND Name Type Length Display Protection MinMax Execute
Change the colors of the numbers or characters.
==============================================================================
This option lets you specify a new color of the characters to be input
or displayed at this location.
Change (Variable)
Name:
==============================================================================
CHANGE VARIABLE. Make all your changes and type "E" to proceed
Background Foreground NAME Type Length Display Protection MinMax Execute
Change the name of the variable.
==============================================================================
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 21
Change
If you are using ScreenEngine only to design a screen and obtain the
coordinates of the display fields, you do not need to give a name to the
variables. However, if you wish to generate the complete Turbo-Pascal
source code,it is convenient to give the variable a name. If you do not,
ScreenEngine will generate a name automatically.
Change (Variable)
Type
==============================================================================
CHANGE VARIABLE. Make all your changes and type "E" to proceed
Background Foreground Name TYPE Length Display Protection MinMax Execute
Change from integer to real, string, or date, real to integer or string, etc.
==============================================================================
Selecting CHANGE TYPE will cause ScreenEngine to go through the
following steps:
1) Display the Variable Type Menu.
2) Prompt the user to input the display format of the variable for
real or date-type variables.
Change (Variable)
Type
Integer:
==============================================================================
Select type of variable
INTEGER Real String Date
Variable will be a Turbo Pascal integer.
==============================================================================
Integer variables follow the definition for Turbo Pascal integer
variables. There is only one display format for integer variables.
Therefore, the user will not be asked to choose a format.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 22
Change
Change (Variable)
Type
Real:
==============================================================================
Select type of variable
Integer REAL String Date
Variable will be a Turbo Pascal real.
==============================================================================
Real variables correspond to Turbo Pascal real variables. The first
option ScreenEngine will give you after selecting Real is the selection
of the output format of this variable. This option is explained below
under the "Change (Variable) Display".
Change (Variable)
Type
String:
==============================================================================
Select type of variable
Integer Real STRING Date
Variable will be a String of up to 80 characters.
==============================================================================
String variables correspond to Turbo Pascal String type variables.
ScreenEngine will declare these variables as String[nn] where nn is the
length of the field in which the variables will be displayed or input.
String variables have no format. ScreenEngine allows you to specify
maximum or minimum values to validate these variables.
Change (Variable)
Type
Date:
==============================================================================
Select type of variable
Integer Real String DATE
Variable will be a String[6] containing a date.
==============================================================================
Date variables were described in Section 2.3. ScreenEngine will prompt
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 23
Change
the user to choose a format for these variables. See "Change (Variable)
Display", below, for the different display options available to Date
variables.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 24
Change
Change (Variable)
Length:
==============================================================================
CHANGE VARIABLE. Make all your changes and type "E" to proceed
Background Foreground Name Type LENGTH Display Protection MinMax Execute
Change the length of the display field.
==============================================================================
You may be able to change the length of the input/output field for any
variables except Date, because these have a fixed 8 position field. For
the other variable types, ScreenEngine will clear the small window from
the display to allow you to view the area in which the variable will be
located, and ask you to press the [Space] bar to input the new field
length. Press [Enter when finished. If you do not input enough spaces
for variables with scientific format display, ScreenEngine will beep and
an error message will be displayed. Correct the length of the display
field and press [Enter] to return to the Change variable menu.
==============================================================================
CHANGE VARIABLE. Make all your changes and type "E" to proceed
Background Foreground Name Type Length DISPLAY Protection MinMax Execute
Change the display format of integer, real or date variables.
==============================================================================
Change (Variable)
Display:
ScreenEngine allows you to specify four different display formats for
real and six different display formats for date variables. According to
the type of variable you are changing, ScreenEngine will display a
different menu.
Change (Real variable)
Display
Scientific:
==============================================================================
Select output format
SCIENTIFIC Fixed Dollar Percent Comma
Display variable with a Scientific format such as 1.234E-5
==============================================================================
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 25
Change
If you select SCIENTIFIC format output the variable will be displayed in
scientific format, but the user may enter the variable in fixed format.
When selecting Scientific format, ScreenEngine will check if there is
enough space in the display field to accomodate the exponent, the signs,
the letter E, and the decimal point. If there is not enough space,
ScreenEngine will beep and display an error message asking you to
increase the length of the display field. Proceed with the corrections,
press [Enter] and return to the Change Variable menu.
Change (Real variable)
Display
Fixed:
==============================================================================
Select output format
Scientific FIXED Dollar Percent Comma
Display variable with a Fixed format such as 1234.56
==============================================================================
After you select Fixed format, ScreenEngine will ask you to input the
number of decimals in the field.
Change (Real variable)
Display
Dollar:
==============================================================================
Select output format
Scientific Fixed DOLLAR Percent Comma
Display variable with a Dollar sign format such as $1,234.56
==============================================================================
Variables displayed with a Dollar sign format will have a leading $; the
thousands, millions, etc. will be separated by commas. Negative values
will be enclosed in parenthesis, as ($33,251.25).
In input, commas typed by the user will be ignored. Negative values may
be input either with a minus sign or a leading opening parenthesis.
ScreenEngine will ask you to input the number of decimals in the field.
Choose the default of 2 by pressing [ENTER], or input any other allowed
number.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 26
Change
Change (Real variable)
Display
Percent:
==============================================================================
Select output format
Scientific Fixed Dollar PERCENT Comma
Display variable with a Percent sign format such as 12.43%
==============================================================================
Variables with a percent format will be multiplied by 100.0 before being
displayed; a % sign will be added at the end; a comma will be used to
separate every 3 digits over 1,000%; negative numbers will be displayed
with a leading minus sign.
In input, the commas will be ignored, and the percent sign will be
properly considered. That is, if the user inputs 1.23%, the
corresponding variable will take the value 0.0123. If the user inputs
1.23, the variable will take the value 1.23, which corresponds to 123.0%
Change (Real variable)
Display
Comma:
==============================================================================
Select output format
Scientific Fixed Dollar Percent COMMA
Display variable with a comma format such as 1,234.56
==============================================================================
The comma display format works identically to the dollar sign format,
except that there is no leading $ in the field.
In input, commas typed by the user will be ignored. Negative values may
be input either with a minus sign or a leading opening parenthesis.
Change (Variable)
Protection:
==============================================================================
CHANGE VARIABLE. Make all your changes and type "E" to proceed
Background Foreground Name Type Length Display PROTECTION MinMax Execute
Change this variable from display-only to display and change, or viceversa.
==============================================================================
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 27
Change
In ScreenEngine "Protection" of a variable refers to as whether the
user of the generated program will be allowed to change the variable or
not. After selecting "Protection", ScreenEngine will display a sub
menu, the options of which are described next.
==============================================================================
Should this variable be protected from being changed by the user?
YES No
The generated program will only display this variable.
==============================================================================
==============================================================================
Should this variable be protected from being changed by the user?
Yes NO
The user will be allowed to input and/or edit this variable.
==============================================================================
Selecting "No" from the above menu will direct ScreenEngine to generate
code that will prompt the user to input a value for this variable.
Selecting "Yes", will cause your generated program to display the
variable without ever prompting the user to input or modify this field.
You may want to use this feature on some ocasions, such as when
displaying today's date, or other information the user is not allowed
to modify.
Change (Variable)
MinMax:
==============================================================================
CHANGE VARIABLE. Make all your changes and type "E" to proceed
Background Foreground Name Type Length Display Protection MINMAX Execute
Change the minimum or maximum values the user can specify for this variable.
==============================================================================
The Minmax option allows you to specify the maximum and minimum values
that a user can input for a variable. ScreenEngine will ask the
following question:
==============================================================================
VARIABLE RANGE: Do you want to specify a range of acceptable values?
NO Yes
Accept any value.
==============================================================================
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 28
Change
Select this option if your program does not need to check for validity
of data.
If your program requires a check for validity of data, select the
following option:
==============================================================================
VARIABLE RANGE: Do you want to specify a range of acceptable values?
No YES
Input a minimum and maximum value within which the data will be valid.
==============================================================================
ScreenEngine then will ask you for the minimum and maximum values for
this variable. The generated code will check for data validity when the
user inputs new data, or modifies existing information.
Change (Variable)
Execute:
==============================================================================
CHANGE VARIABLE. Make all your changes and type "E" to proceed
Background Foreground Name Type Length Display Protection MinMax EXECUTE
Proceed with the changes and return to screen design menu.
==============================================================================
Choose this option once you have made all your changes. ScreenEngine
will make the changes effective and return to the Screen Design Menu.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 29
Move
2.5 Move
==============================================================================
SCREEN DESIGN MENU
Box Label Variable Change MOVE Duplicate Alter Erase Unerase Sort Quit
Move elsewhere any single item or several items in a rectangular screen range.
==============================================================================
The Move option allows you to move any item elsewhere on the screen. You
may also want to move any number of items fully enclosed within a
rectangular area of the screen, which is referred to as a "range". After
selecting "Move", ScreenEngine will ask you to whether you want to move a
single item or all items within a range.
==============================================================================
WHAT DO YOU WANT TO MOVE?
ITEM Range
Move a single item: Label, Variable, Line, Box, Complex box, box drawing char.
==============================================================================
If you choose this option, you will be asked to position the cursor on top
of the item you want to move. Move the cursor using the cursor keys and
press [Enter] when it is positioned anywhere on the item.
==============================================================================
WHAT DO YOU WANT TO MOVE?
Item RANGE
Move elsewhere all items fully contained within a rectangular area.
==============================================================================
This option lets you move all items FULLY contained within a rectangular
area of the screen. Because of the special way ScreenEngine handles
complex boxes, there is no need to use "Move range" to move a box and all
its subcomponents. After you select "Range", ScreenEngine will ask you to
mark the rectangular area of the screen from where you want to move the
items. After you select the rectangular area, use the cursor keys to show
the new place where you want the items to be moved. Notice that
ScreenEngine will move a rectangular area of the same size as the one you
indicated to help you in determining the best new location. The items to
be moved are temporarily surrounded by a blinking box.
WARNING: Currently, there is no provision to prevent you from wrapping
the moving box around the screen. If you move the box beyond the screen
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 30
Move
limits, the box will appear distorted and ScreenEngine will not move
anything.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 31
Duplicate
2.5 Duplicate
==============================================================================
SCREEN DESIGN MENU
Box Label Variable Change Move DUPLICATE Alter Erase Unerase Sort Quit
Copy any single item and its attributes anywhere on the screen.
==============================================================================
The Duplicate option allows you to reproduce any item. ScreenEngine will
prompt you to 1) mark the item you want to duplicate, and 2) to mark the
location on the screen where the new item will be located. Notice that
complex boxes will be fully reproduced. Notice also that when duplicating
variables the names of the variables will also be duplicated. This would
cause the generated program to give a compilation time error. To avoid
this, use the change command to change the name of the variables you have
created by "Duplicating".
ScreenEngine will check that the position on the screen you have indicated
will not cause the item to wrap around the screen.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 32
Alter
2.6 Alter
==============================================================================
SCREEN DESIGN MENU
Box Label Variable Change Move Duplicate ALTER Erase Unerase Sort Quit
Alter default colors for screen, boxes, labels or variables.
==============================================================================
The "Alter" option lets you change the default background and foreground
colors of the screen and any items to be designed. It does not change the
colors of the items already placed on the screen. If you want to change
the background or foreground of the items already on the screen, please
use the "Change" option. After you choose the "Alter" option, you are
asked to choose the type of item for which you want to "Alter" the color
defaults:
==============================================================================
ALTER DEFAULTS. Make all your changes and select EXECUTE to proceed
SCREEN Box Label Variable Execute
Change screen color.
==============================================================================
Choosing any of the options will cause ScreenEngine to display the color
menu for background and foreground. Since all are identical, they will not
be explained in further detail here. After you have finished making the
changes, select "Execute" to make the changes effective and return to the
screen design menu.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 33
Erase
2.6 Erase
==============================================================================
SCREEN DESIGN MENU
Box Label Variable Change Move Duplicate Alter ERASE Unerase Sort Quit
Erase any single item on the screen.
==============================================================================
The "Erase" option lets you erase any items you have created. If you are
going to erase a complex box, all subcomponents of the box will be erased.
ScreenEngine will ask you to indicate the item to be erased by placing the
cursor over that item.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 34
UnErase
2.7 UnErase
==============================================================================
SCREEN DESIGN MENU
Box Label Variable Change Move Duplicate Alter Erase UNERASE Sort Quit
Erase any single item on the screen.
==============================================================================
The "UnErase" option lets you recover the most recently erased item.
Because "Complex boxes" are actually composed of a number of items, TURBO-
SCREEN will not be able to fully recover the complete Complex box. Unerase
will recover just the "Mother" box.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 35
Sort
2.8 Sort
==============================================================================
SCREEN DESIGN MENU
Box Label Variable Change Move Duplicate Alter Erase Unerase SORT Quit
Variables Boxes
==============================================================================
The "Sort" option has two different uses:
1) Selecting the order in which the variables will be input in the
generated program, and
2) Selecting the order in which boxes are drawn on the screen.
The order in which the generated program will ask the variables to be
input depends on the order in which the variables were created in
ScreenEngine. In many cases this will be a satisfactory order. However, if
the designer of the screen moves some variables around the screen, the
order in which these variables will be input may not be the most logical
one. In these cases, the screen designer may use "Sort" to specify a
particular order.
The second use of "Sort" is helpful when the screen designer decides to
create a new box that will surround one or more previously created boxes.
Once the new box is created, it will paint over the previous boxes. In
this case, the screen designer can use "Sort" to specify the order in
which the boxes will be drawn on the screen. Because some of the boxes
are painted over, ScreenEngine will show the boxes in a "see-through"
mode, whereby the interior background of the box will not be painted.
The procedure to use sort is identical in both cases:
Place the cursor anywhere on the first variable or box, and press [Enter].
ScreenEngine will write the sort order on the upper left corner of the box
or line, or on the left corner of the variable input/output field. Move
the cursor to the second variable or box and press [Enter]. Repeat the
process until you reach the last variable or box. Press [Enter] twice
while on the last variable or box (The first time to indicate the order,
the second time to indicate that you have finished). ScreenEngine will
internally sort the items and return to the Screen Design Menu.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Screen Design Menu Page 36
Quit
2.9 Quit
==============================================================================
SCREEN DESIGN MENU
Box Label Variable Change Move Duplicate Alter Erase Unerase Sort QUIT
Return to main menu to SAVE, RETRIEVE, CLEAR, or QUIT.
==============================================================================
The "Quit" option lets you return to the main menu. You may be able to
save your work, to combine the current screen with a previously created
one, to erase the screen or to leave ScreenEngine.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Generated Program and Utilities Page 37
Generated Program
3. The Generated Program and the ScreenEngine utilites.
3.1 The Generated Program.
3.1.1 Generated Procedures.
ScreenEngine generates a Turbo Pascal program. In the diskette you will
find a program called "SAMPLE.PAS" which is a sample of an unedited
generated program. ScreenEngine creates a main program and several
procedures. We will describe the generated procedures with base on
SAMPLE.PAS.
The following are the procedures you will find defined in SAMPLE.PAS:
Program ScrnSample;
procedure PutTitleScrnSample;
procedure OutVarScrnSample(......
procedure InpVarScrnSample(......
procedure InpScrnSample(......
procedure EditScrnSample(......
procedure OutScrnSample(......
ScreenEngine creates a small main program with the name ScrnXXXX, where
XXXX is the name you gave to the screen. The reason for creating a small
main program is that you will immediately be able to compile and test
your screen using your Turbo Pascal compiler. Then you may be able to
edit those parts of ScrnXXXX you are not interested in.
PutTitleScrnXXXX.
This procedure writes to the screen the labels and boxes you designed.
OutVarScrnXXXX.
This procedure writes the values of the variables.
InpVarScrnXXXX.
This procedure INPuts the VARiables from the SCReen. This is the
procedure that moves the cursor from one variable input/display area to
another. It works in the following fashion:
1) The counter L is initialized at 1.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Generated Program and Utilities Page 38
Generated Program
2) The "case" statement is used to go through all variables, according
to the current value of L.
3) At the end of the case statement, the program checks for the last key
pressed when inputting any of the variables. The counter is increased
by 1 if the last key pressed was the [Enter] (^M) the [Tab] (^I), or
the [Right] arrow key (Chr1 = #27 and Chr2 = 'P').
The counter is decreased by 1 if the keys pressed were the [Up] key
(Chr1 = #27 and Chr2 = 'H') or the [Shift][Tab] key (Chr1 = #27 and
Chr2 = #15).
4) The process is repeated until the user presses the [Ctrl][Enter] keys
(Chr1 = #10), or the [Enter] key was pressed after the final variable
was input. In this case the counter was set to 1 which causes the
termination of the "repeat" statement.
The variables are requested in the order in which they were defined at
the
moment of designing the screen, or in the order in which they were
"Sorted". If the variables appear in a column, using the [Up] and [Down]
arrow keys used to move from item to item is quite intuitive. If the
variables are in a row, the use of the [Up] and [Down] keys to move from
one variable to the one on its left or the one its right is not very
intuitive. Notice that the [Right] or [Left] arrow keys are used for
the moving the cursor within a variable's input field and are not
eligible to be used to move from one field to another. You may want to
define some other keys by editing the generated source program.
InpScrXXXX.
This procedure has the following functions:
1) Initialize variables. (You may want to do your own initialization).
2) Put on the screen the values of the variables by calling
OutVarScrXXXX.
3) Call the InpVarScrXXXX procedure to proceed to capture the values.
EditScrXXXX.
This procedure differs from InpScrXXXX in that it does not initialize
the variables.
OutScrXXXX.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Generated Program and Utilities Page 39
Generated Program
This procedure simply displays the screen with labels, boxes and the
current variable's values, without allowing the user to change any
variables.
3.1.2 The Predefined Variables.
ScreenEngine defines a few global variables for its own use:
type
TSStr = String[80];
TSCharSet = set of char;
TSDate = String[6];
{Global variables}
var
TSString : TSStr;
TSDefAttrib: byte; {Screen color attribute}
TSInsMode : boolean; {keeps track of the insert key}
Notice that all those variable type and variables start with the
characters "TS", to avoid confusion with your program's own variables.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Generated Program and Utilities Page 40
The ScreenEngine Utilities
3.2 The ScreenEngine Utilities.
3.2.1 SE.UTL
The file SE.UTL contains the procedures and functions which are common to
the remaining utilities.
procedure Beep;
Beeps the bell.
procedure Box(UpperLeftX, UpperLeftY, LowerRightX, LowerRightY,
BoxType, ColAttribute: byte;
CharStr:TSStr);
Draws a box on the screen with upper left corner at coordinates
"UpperLeftX, UpperLeftY" and lower right corner at coordinates
"Lower RightX and LowerRightY".
Box type = 1 : single line.
2 : double line.
3 : half character wide line.
4 : full character wide line.
ColAttribute : Color attribute.
CharString : If not empty, this string contains the coordinates,
types of the boxes and ASCII codes of the box-
drawing symbols that form part of the "Mother box".
These values are codified into an ASCII string to
make a compact box drawing protocol.
procedure GetString( xo,yo : byte; ColAttribute : byte;
var StrVar : TSStr;
Term1,
Term2 : TSCharSet;
var TC1,TC2 : Char;
L : byte;
MinSt,
MaxSt : TSStr);
This procedure gets a string variable (StrVar) at coordinates xo, yo, in
a field of length "L" bytes. The maximum and minimum values allowed for
this string variable are MinSt and MaxSt, respectively. Term1 and Term2
are two sets of characters that control when the procedure returns. Term1
normally contains the [Enter] (or Return, ^M), [Control][Enter]
(#10), [Tab] (^I), and Escape (#27) characters. Term2 normally contains
the 'P' and 'H' characters that correspond to the second characters
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Generated Program and Utilities Page 41
The ScreenEngine Utilities
generated by the [Down] and [Up] arrow keys. The last characters typed
before the procedure returns are stored in TC1 and TC2.
procedure GetVariable(x,y, ColAttribute : byte;
var S : TSStr;
Term1,
Term2 : TSCharSet;
var TC1,TC2 : Char;
L :byte);
This procedure reads a string at coordinates x,y. The other parameters
are identical to those on GetString. GetVariable is called by GetString,
GetReal, GetInteger and GetDate.
function MakeStr(C:Char;N:Integer): TSStr;
This procedure makes a string of N identical characters(C);
procedure NormCursor;
This procedure changes the shape of the cursor according to whether the
[Ins] key has been pushed or not.
procedurePeelBlanks(
var TSString:TSStr;
var NBlanks,L:byte);
This procedure peels the leading blanks of a string and returns the
number of blanks peeled in NBlanks.
procedure PutVariableOrLabel(xo,yo,ColAttribute:byte;
TSString:TSStr;L:byte);
Puts the TSString variable on the screen, at xo,yo coordinates, with a
color defined by ColAttribute, on a field L bytes long.
procedure scursor(dx:integer);
Inline procedure called by NormCursor.
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Generated Program and Utilities Page 42
The ScreenEngine Utilities
procedure SetColor(ColAttribute:byte);
Sets the foreground and background color.
procedure ResetColor;
Resets the color to the default screen colors.
3.2.2 SEREAL.UTL
procedure ConvReal(RealVar:real;L:byte;
Decimal,NumDec:integer;var TSString:TSStr);
This procedure converts the real variable RealVar into a string
TSString L bytes long, according to the folowing convention:
Decimal = 0 for scientific format
Decimal = 1 for fixed format
Decimal = 2 for comma format
Decimal = 3 for $ format
Decimal = 4 for percent format
NumDec = number of decimals.
procedure GetReal(
xo,yo : byte;
ColAttribute : byte;
var RealVar : real;
Term1, Term2 : TSCharSet;
var TC1,TC2 : Char;
L : byte;
Decimal : byte;
NumDec : byte;
MinReal,
MaxReal : real);
procedure InsCommas(x:real;L,NDec:byte;var AVar:TSStr;DFormat:byte);
procedure PeelChars(var TSString:TSStr;var factor:real);
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Generated Program and Utilities Page 43
The ScreenEngine Utilities
procedure PutReal(
xo,yo,ColAttribute:byte;
RealVar:real;
L:byte;
Decimal: integer;
NumDec : integer);
3.2.2 SEINT.UTL
procedure GetInteger(xo,yo : byte;
ColAttribute : byte;
var IntVar : integer;
Term1,
Term2 : TSCharSet;
var TC1,TC2 : Char;
L : byte;
MinInt,
MaxInt : integer);
procedure PutInteger(xo,yo,ColorAttribute:byte;IntVar:integer;L:byte);
3.2.3 SEDATE.UTL
procedure GetDate(xo,yo : byte;
ColAttribute : byte;
var Date : TSDate;
Term1,
Term2 : TSCharSet;
var Tc1,TC2 : Char;
Sep : char;
Ypos,Mpos,Dpos : byte;
MinDate,MaxDate : TSDate);
function MakeDateStr(Date:TSDate;Ypos,Mpos,Dpos:byte; Sep: char) :
TSStr;
This function converts a date from the internal 6 characters format into
a string, according to the relative location of the month, year and day
specified by the screen designer, and the character used to separate
these items.
procedure PutDate( xo,yo,
ColorAttribute: byte;
Date : TSDate;
Sep : char;
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved
Generated Program and Utilities Page 44
The ScreenEngine Utilities
Ypos,Mpos,Dpos : byte);
Copyright Pedro J. Restrepo, (c) 1986. All Rights Reserved